<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>octant.sw</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="octant-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="octant-module.html">Package&nbsp;octant</a> ::
        Package&nbsp;sw
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
      </table>
    </td>
  </tr>
</table>
<h1 class="epydoc">Source Code for <a href="octant.sw-module.html">Package octant.sw</a></h1>
<pre class="py-src">
<a name="L1"></a><tt class="py-lineno"> 1</tt>  <tt class="py-line"><tt class="py-comment"># --- encoding: iso-8859-1 ---</tt> </tt>
<a name="L2"></a><tt class="py-lineno"> 2</tt>  <tt class="py-line"><tt class="py-comment"></tt> </tt>
<a name="L3"></a><tt class="py-lineno"> 3</tt>  <tt class="py-line"><tt class="py-docstring">"""</tt> </tt>
<a name="L4"></a><tt class="py-lineno"> 4</tt>  <tt class="py-line"><tt class="py-docstring"> Seawater -- Python functions for properties of sea water</tt> </tt>
<a name="L5"></a><tt class="py-lineno"> 5</tt>  <tt class="py-line"><tt class="py-docstring">    Bj&#248;rn &#197;dlandsvik &lt;bjorn@imr.no&gt;,</tt> </tt>
<a name="L6"></a><tt class="py-lineno"> 6</tt>  <tt class="py-line"><tt class="py-docstring">    Institute of Marine Research,</tt> </tt>
<a name="L7"></a><tt class="py-lineno"> 7</tt>  <tt class="py-line"><tt class="py-docstring">    Version 1.1, 13 November 2002</tt> </tt>
<a name="L8"></a><tt class="py-lineno"> 8</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L9"></a><tt class="py-lineno"> 9</tt>  <tt class="py-line"><tt class="py-docstring"> Public functions:</tt> </tt>
<a name="L10"></a><tt class="py-lineno">10</tt>  <tt class="py-line"><tt class="py-docstring"> Density related</tt> </tt>
<a name="L11"></a><tt class="py-lineno">11</tt>  <tt class="py-line"><tt class="py-docstring">   dens(S,T,P)           Density of sea water              kg/m**3</tt> </tt>
<a name="L12"></a><tt class="py-lineno">12</tt>  <tt class="py-line"><tt class="py-docstring">   delta(S,T,P)          Specific volume anomaly           m**3/kg</tt> </tt>
<a name="L13"></a><tt class="py-lineno">13</tt>  <tt class="py-line"><tt class="py-docstring">   sigma(S,T,P)          Density anomaly                   kg/m**3</tt> </tt>
<a name="L14"></a><tt class="py-lineno">14</tt>  <tt class="py-line"><tt class="py-docstring">   drhodt(S,T,P)         Temperature derivative of density kg/(K*m**3)</tt> </tt>
<a name="L15"></a><tt class="py-lineno">15</tt>  <tt class="py-line"><tt class="py-docstring">   alpha(S,T,P)          Thermal expansion coefficient     1/K </tt> </tt>
<a name="L16"></a><tt class="py-lineno">16</tt>  <tt class="py-line"><tt class="py-docstring">   drhods(S,T,P)         Salinity derivative of density    kg/m**3</tt> </tt>
<a name="L17"></a><tt class="py-lineno">17</tt>  <tt class="py-line"><tt class="py-docstring">   beta(S,T,P)           Salinity expansion coefficient</tt> </tt>
<a name="L18"></a><tt class="py-lineno">18</tt>  <tt class="py-line"><tt class="py-docstring">   </tt> </tt>
<a name="L19"></a><tt class="py-lineno">19</tt>  <tt class="py-line"><tt class="py-docstring"> Salinity related</tt> </tt>
<a name="L20"></a><tt class="py-lineno">20</tt>  <tt class="py-line"><tt class="py-docstring">   salt(R,T,P)           Salinity</tt> </tt>
<a name="L21"></a><tt class="py-lineno">21</tt>  <tt class="py-line"><tt class="py-docstring">   cond(S,T,P)           Conductivity ratio</tt> </tt>
<a name="L22"></a><tt class="py-lineno">22</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L23"></a><tt class="py-lineno">23</tt>  <tt class="py-line"><tt class="py-docstring"> Heat related</tt> </tt>
<a name="L24"></a><tt class="py-lineno">24</tt>  <tt class="py-line"><tt class="py-docstring">   heatcap(S,T,P)        Heat capacity                     J/(kg*K)</tt> </tt>
<a name="L25"></a><tt class="py-lineno">25</tt>  <tt class="py-line"><tt class="py-docstring">   adtgrad(S,T,P)        Adiabatic lapse rate              K/dbar</tt> </tt>
<a name="L26"></a><tt class="py-lineno">26</tt>  <tt class="py-line"><tt class="py-docstring">   temppot(S,T,P,Pref)   Potential temperature             &#176;C</tt> </tt>
<a name="L27"></a><tt class="py-lineno">27</tt>  <tt class="py-line"><tt class="py-docstring">   temppot0(S,T,P)       Potential temperature             &#176;C</tt> </tt>
<a name="L28"></a><tt class="py-lineno">28</tt>  <tt class="py-line"><tt class="py-docstring">   </tt> </tt>
<a name="L29"></a><tt class="py-lineno">29</tt>  <tt class="py-line"><tt class="py-docstring"> Miscellaneous</tt> </tt>
<a name="L30"></a><tt class="py-lineno">30</tt>  <tt class="py-line"><tt class="py-docstring">   freezept(S,P)         Freezing point                    &#176;C</tt> </tt>
<a name="L31"></a><tt class="py-lineno">31</tt>  <tt class="py-line"><tt class="py-docstring">   soundvel(S,T,P)       Sound velocity                    m/s</tt> </tt>
<a name="L32"></a><tt class="py-lineno">32</tt>  <tt class="py-line"><tt class="py-docstring">   depth(P,lat)          Depth                             m</tt> </tt>
<a name="L33"></a><tt class="py-lineno">33</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L34"></a><tt class="py-lineno">34</tt>  <tt class="py-line"><tt class="py-docstring"> Arguments:</tt> </tt>
<a name="L35"></a><tt class="py-lineno">35</tt>  <tt class="py-line"><tt class="py-docstring">   S     = Salinity                 </tt> </tt>
<a name="L36"></a><tt class="py-lineno">36</tt>  <tt class="py-line"><tt class="py-docstring">   T     = Temperature               &#176;C</tt> </tt>
<a name="L37"></a><tt class="py-lineno">37</tt>  <tt class="py-line"><tt class="py-docstring">   P     = Pressure                  dbar </tt> </tt>
<a name="L38"></a><tt class="py-lineno">38</tt>  <tt class="py-line"><tt class="py-docstring">   R     = Conductivity ratio</tt> </tt>
<a name="L39"></a><tt class="py-lineno">39</tt>  <tt class="py-line"><tt class="py-docstring">   Pref  = Reference pressure        dbar</tt> </tt>
<a name="L40"></a><tt class="py-lineno">40</tt>  <tt class="py-line"><tt class="py-docstring">   lat   = Latitude                  deg</tt> </tt>
<a name="L41"></a><tt class="py-lineno">41</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L42"></a><tt class="py-lineno">42</tt>  <tt class="py-line"><tt class="py-docstring"> References:</tt> </tt>
<a name="L43"></a><tt class="py-lineno">43</tt>  <tt class="py-line"><tt class="py-docstring">   [Bryden 1973], New polynomials for thermal expansion, adiabatic</tt> </tt>
<a name="L44"></a><tt class="py-lineno">44</tt>  <tt class="py-line"><tt class="py-docstring">   temperature gradient and potential temperature gradient of sea water</tt> </tt>
<a name="L45"></a><tt class="py-lineno">45</tt>  <tt class="py-line"><tt class="py-docstring">   Deep-Sea Res. 20, 401-408</tt> </tt>
<a name="L46"></a><tt class="py-lineno">46</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L47"></a><tt class="py-lineno">47</tt>  <tt class="py-line"><tt class="py-docstring">   [UNESCO 1981], Tenth report of the joint panel on oceanographic</tt> </tt>
<a name="L48"></a><tt class="py-lineno">48</tt>  <tt class="py-line"><tt class="py-docstring">   tables and standards, Unesco technical papers in marine science 36.</tt> </tt>
<a name="L49"></a><tt class="py-lineno">49</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L50"></a><tt class="py-lineno">50</tt>  <tt class="py-line"><tt class="py-docstring">   [UNESCO 1983], N.P. Fofonoff and R.C. Millard Jr., Algorithms for</tt> </tt>
<a name="L51"></a><tt class="py-lineno">51</tt>  <tt class="py-line"><tt class="py-docstring">   computation of fundamental properties of seawater, Unesco technical</tt> </tt>
<a name="L52"></a><tt class="py-lineno">52</tt>  <tt class="py-line"><tt class="py-docstring">   papers in marine science 44.</tt> </tt>
<a name="L53"></a><tt class="py-lineno">53</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L54"></a><tt class="py-lineno">54</tt>  <tt class="py-line"><tt class="py-docstring">"""</tt> </tt>
<a name="L55"></a><tt class="py-lineno">55</tt>  <tt class="py-line"> </tt>
<a name="L56"></a><tt class="py-lineno">56</tt>  <tt class="py-line"><tt class="py-comment"># --- Exceptions ---</tt> </tt>
<a name="OutOfRangeError"></a><div id="OutOfRangeError-def"><a name="L57"></a><tt class="py-lineno">57</tt> <a class="py-toggle" href="#" id="OutOfRangeError-toggle" onclick="return toggle('OutOfRangeError');">-</a><tt class="py-line"><tt class="py-comment"></tt><tt class="py-keyword">class</tt> <a class="py-def-name" href="octant.sw.OutOfRangeError-class.html">OutOfRangeError</a><tt class="py-op">(</tt><tt class="py-base-class">Exception</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-keyword">pass</tt> </tt>
</div><a name="L58"></a><tt class="py-lineno">58</tt>  <tt class="py-line"> </tt>
<a name="L59"></a><tt class="py-lineno">59</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-0" class="py-name" targets="Module octant.sw.density=octant.sw.density-module.html"><a title="octant.sw.density" class="py-name" href="#" onclick="return doclink('link-0', 'density', 'link-0');">density</a></tt> <tt class="py-keyword">import</tt> <tt id="link-1" class="py-name" targets="Function octant.sw.density.dens()=octant.sw.density-module.html#dens"><a title="octant.sw.density.dens" class="py-name" href="#" onclick="return doclink('link-1', 'dens', 'link-1');">dens</a></tt><tt class="py-op">,</tt> <tt id="link-2" class="py-name" targets="Function octant.sw.density.svan()=octant.sw.density-module.html#svan"><a title="octant.sw.density.svan" class="py-name" href="#" onclick="return doclink('link-2', 'svan', 'link-2');">svan</a></tt><tt class="py-op">,</tt> <tt id="link-3" class="py-name" targets="Function octant.sw.density.sigma()=octant.sw.density-module.html#sigma"><a title="octant.sw.density.sigma" class="py-name" href="#" onclick="return doclink('link-3', 'sigma', 'link-3');">sigma</a></tt><tt class="py-op">,</tt> <tt id="link-4" class="py-name" targets="Function octant.sw.density.drhodt()=octant.sw.density-module.html#drhodt"><a title="octant.sw.density.drhodt" class="py-name" href="#" onclick="return doclink('link-4', 'drhodt', 'link-4');">drhodt</a></tt><tt class="py-op">,</tt> <tt id="link-5" class="py-name" targets="Function octant.sw.density.alpha()=octant.sw.density-module.html#alpha"><a title="octant.sw.density.alpha" class="py-name" href="#" onclick="return doclink('link-5', 'alpha', 'link-5');">alpha</a></tt><tt class="py-op">,</tt> <tt id="link-6" class="py-name" targets="Function octant.sw.density.drhods()=octant.sw.density-module.html#drhods"><a title="octant.sw.density.drhods" class="py-name" href="#" onclick="return doclink('link-6', 'drhods', 'link-6');">drhods</a></tt><tt class="py-op">,</tt> <tt id="link-7" class="py-name" targets="Function octant.sw.density.beta()=octant.sw.density-module.html#beta"><a title="octant.sw.density.beta" class="py-name" href="#" onclick="return doclink('link-7', 'beta', 'link-7');">beta</a></tt> </tt>
<a name="L60"></a><tt class="py-lineno">60</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-8" class="py-name" targets="Module octant.sw.salinity=octant.sw.salinity-module.html"><a title="octant.sw.salinity" class="py-name" href="#" onclick="return doclink('link-8', 'salinity', 'link-8');">salinity</a></tt> <tt class="py-keyword">import</tt> <tt id="link-9" class="py-name" targets="Function octant.sw.salinity.salt()=octant.sw.salinity-module.html#salt"><a title="octant.sw.salinity.salt" class="py-name" href="#" onclick="return doclink('link-9', 'salt', 'link-9');">salt</a></tt><tt class="py-op">,</tt> <tt id="link-10" class="py-name" targets="Function octant.sw.salinity.cond()=octant.sw.salinity-module.html#cond"><a title="octant.sw.salinity.cond" class="py-name" href="#" onclick="return doclink('link-10', 'cond', 'link-10');">cond</a></tt> </tt>
<a name="L61"></a><tt class="py-lineno">61</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-11" class="py-name" targets="Module octant.sw.heat=octant.sw.heat-module.html"><a title="octant.sw.heat" class="py-name" href="#" onclick="return doclink('link-11', 'heat', 'link-11');">heat</a></tt> <tt class="py-keyword">import</tt> <tt id="link-12" class="py-name" targets="Function octant.sw.heat.heatcap()=octant.sw.heat-module.html#heatcap"><a title="octant.sw.heat.heatcap" class="py-name" href="#" onclick="return doclink('link-12', 'heatcap', 'link-12');">heatcap</a></tt><tt class="py-op">,</tt> <tt id="link-13" class="py-name" targets="Function octant.sw.heat.adtgrad()=octant.sw.heat-module.html#adtgrad"><a title="octant.sw.heat.adtgrad" class="py-name" href="#" onclick="return doclink('link-13', 'adtgrad', 'link-13');">adtgrad</a></tt><tt class="py-op">,</tt> <tt id="link-14" class="py-name" targets="Function octant.sw.heat.temppot()=octant.sw.heat-module.html#temppot"><a title="octant.sw.heat.temppot" class="py-name" href="#" onclick="return doclink('link-14', 'temppot', 'link-14');">temppot</a></tt><tt class="py-op">,</tt> <tt id="link-15" class="py-name" targets="Function octant.sw.heat.temppot0()=octant.sw.heat-module.html#temppot0"><a title="octant.sw.heat.temppot0" class="py-name" href="#" onclick="return doclink('link-15', 'temppot0', 'link-15');">temppot0</a></tt> </tt>
<a name="L62"></a><tt class="py-lineno">62</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-16" class="py-name" targets="Module octant.sw.misc=octant.sw.misc-module.html"><a title="octant.sw.misc" class="py-name" href="#" onclick="return doclink('link-16', 'misc', 'link-16');">misc</a></tt> <tt class="py-keyword">import</tt> <tt id="link-17" class="py-name" targets="Function octant.sw.misc.freezept()=octant.sw.misc-module.html#freezept"><a title="octant.sw.misc.freezept" class="py-name" href="#" onclick="return doclink('link-17', 'freezept', 'link-17');">freezept</a></tt><tt class="py-op">,</tt> <tt id="link-18" class="py-name" targets="Function octant.sw.misc.soundvel()=octant.sw.misc-module.html#soundvel"><a title="octant.sw.misc.soundvel" class="py-name" href="#" onclick="return doclink('link-18', 'soundvel', 'link-18');">soundvel</a></tt><tt class="py-op">,</tt> <tt id="link-19" class="py-name" targets="Function octant.sw.misc.depth()=octant.sw.misc-module.html#depth"><a title="octant.sw.misc.depth" class="py-name" href="#" onclick="return doclink('link-19', 'depth', 'link-19');">depth</a></tt> </tt>
<a name="L63"></a><tt class="py-lineno">63</tt>  <tt class="py-line"> </tt><script type="text/javascript">
<!--
expandto(location.href);
// -->
</script>
</pre>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="octant-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1
    on Mon Apr 20 11:56:33 2009
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
